var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("BaseModuleUI"),
    a = e("GlobalParams"),
    i = e("Game"),
    r = cc._decorator,
    s = r.ccclass,
    l = r.property,
    c = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (
                (t.skin_node = null),
                (t.now_node = null),
                (t.over_node = null),
                (t.days_num = null),
                (t.signin_node = null),
                (t.coin_num_label = null),
                (t.award_node = null),
                (t.award_type = null),
                (t.signin_index = 0),
                (t.signin_info = null),
                (t.signin_type_string = ["金币补给", "钻石补给", "绝版英雄"]),
                t
            );
        }
        return (
            __extends(t, e),
            (t.prototype.showSigninInfo = function (e) {
                (this.signin_index = e), (this.signin_info = i.default.signin_info[this.signin_index]);
                var t = a.GlobalParams.PlayerSigninInfo.value,
                    o = t.signin_num;
                t.signin_date == new Date().toLocaleDateString() && (o -= 1),
                    o > 6 && 6 == this.signin_index && (this.signin_info = i.default.signin_info[7]),
                    (this.days_num.string = "" + this.signin_info.days),
                    (this.coin_num_label.string = "x" + this.signin_info.num),
                    (this.skin_node.active = o < 7 && 7 == this.signin_info.days),
                    (this.now_node.active =
                        o % 7 == this.signin_info.days - 1 && t.signin_date != new Date().toLocaleDateString()),
                    (this.over_node.active =
                        this.signin_info.days <= o % 7 ||
                        (t.signin_date == new Date().toLocaleDateString() && o % 7 == this.signin_info.days - 1)),
                    (this.signin_node.active = this.over_node.active),
                    (this.award_node.children[0].active =
                        !this.skin_node.active && !this.over_node.active && 0 == this.signin_info.type),
                    (this.award_node.children[1].active = this.skin_node.active),
                    (this.award_node.children[2].active = this.over_node.active && 0 == this.signin_info.type),
                    (this.award_node.children[3].active =
                        !this.skin_node.active && !this.over_node.active && 1 == this.signin_info.type),
                    (this.award_node.children[4].active = this.over_node.active && 1 == this.signin_info.type),
                    (this.award_type.string = "" + this.signin_type_string[this.signin_info.type]),
                    this.now_node.active
                        ? (this.award_type.node.color = new cc.Color(230, 179, 28))
                        : this.skin_node.active
                        ? (this.award_type.node.color = new cc.Color(140, 68, 195))
                        : this.over_node.active
                        ? (this.award_type.node.color = new cc.Color(150, 150, 150))
                        : (this.award_type.node.color = new cc.Color(14, 143, 210)),
                    (this.node.getComponent(cc.Button).interactable = this.now_node.active);
            }),
            __decorate([l(cc.Node)], t.prototype, "skin_node", void 0),
            __decorate([l(cc.Node)], t.prototype, "now_node", void 0),
            __decorate([l(cc.Node)], t.prototype, "over_node", void 0),
            __decorate([l(cc.Label)], t.prototype, "days_num", void 0),
            __decorate([l(cc.Node)], t.prototype, "signin_node", void 0),
            __decorate([l(cc.Label)], t.prototype, "coin_num_label", void 0),
            __decorate([l(cc.Node)], t.prototype, "award_node", void 0),
            __decorate([l(cc.Label)], t.prototype, "award_type", void 0),
            __decorate([s], t)
        );
    })(n.default);
o.default = c;
